package com.example.newsmanager.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.newsmanager.entity.News;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NewsMapper extends BaseMapper<News> {
    @Select("SELECT n.*,u.nickname AS author FROM news n INNER JOIN user u ON n.user_id=u.user_id")
    List<News> getAllNewsWithAuthor();
}

